package leetcode;

public class LastWordLength {

	public static void main(String[] args) {
		lengthOfLastWord("      ");
	}
	public static int lengthOfLastWord(String s) {
        if(s == null || s == ""){
            return 0;
        }
        String[] words = s.split(" ");
        System.out.println(words.length);
        if(words.length != 0){
        	return words[words.length - 1].length();
        }
        return 0;
    }
}
